﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Negocio;
using System.Collections.ObjectModel;

namespace Persistencia
{
    abstract class Broker
    {
        protected ConnectionDB conn;

        public static Broker createBroker(Object o)
        {
            if (o.GetType().IsInstanceOfType(new Player()))
            {
                return new BrokerPlayer();
            }
            if (o.GetType().IsInstanceOfType(new Group()))
            {
                return new BrokerGroup();
            }
            if (o.GetType().IsInstanceOfType(new Test()))
            {
                return new BrokerTest();
            }
            if (o.GetType().IsInstanceOfType(new Evaluation()))
            {
                return new BrokerEvaluation();
            }
            if (o.GetType().IsInstanceOfType(new ReferenceMeasure()))
            {
                return new BrokerReferenceMeasure();
            }

            if (o.GetType().IsInstanceOfType(new PlayerExecution()))
            {
                return new BrokerPlayerExecution();
            }
            if (o.GetType().IsInstanceOfType(new TestValue()))
            {
                return new BrokerTestValue();
            }
            if (o.GetType().IsInstanceOfType(new Injury()))
            {
                return new BrokerInjury();
            }
            if (o.GetType().IsInstanceOfType(new Disease()))
            {
                return new BrokerDisease();
            }
            if (o.GetType().IsInstanceOfType(new ClinicalHistory()))
            {
                return new BrokerClinicalHistory();
            }
            else
            {
                return null;

            }



        }
        public abstract void add(object o);
        public abstract void update(object o);
        public abstract void delete(object o);
        public abstract void bringData(object o);
        public abstract ObservableCollection<Object> bringList(Object o);

    }
}
